package com.whut.monitor.model;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by CFlower on 2017/11/7.
 * 时间工况表
 */
@Entity
@Table(name = "t_time_machining")
public class TimeMachiningEntity {
    // 时间ID
    private Integer id;
    private MachiningEntity machiningEntity;
    private EquipmentEntity equipmentEntity;
    // 工况日期
    private Date machiningDate;
    // 加工开始时间
    private Date startTime;
    // 加工结束时间
    private Date endTime;
    // 备注
    private String  descript;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name="machining_id")
    public MachiningEntity getMachiningEntity() {
        return machiningEntity;
    }
    public void setMachiningEntity(MachiningEntity machiningEntity) { this.machiningEntity = machiningEntity; }

    @ManyToOne
    @JoinColumn(name = "equipment_id")
    public EquipmentEntity getEquipmentEntity() {
        return equipmentEntity;
    }
    public void setEquipmentEntity(EquipmentEntity equipmentEntity) {
        this.equipmentEntity = equipmentEntity;
    }

    @Column(name="date")
    public Date getMachiningDate() {return machiningDate;}
    public void setMachiningDate(Date machiningDate) {
        this.machiningDate = machiningDate;
    }

    @Column(name="start_time")
    public Date getStartTime() {return startTime;}
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    @Column(name="end_time")
    public Date getEndTime() {return endTime;}
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Column(name="descript")
    public String getDescript() {
        return descript;
    }
    public void setDescript(String descript) {
        this.descript = descript;
    }
}
